package com.yunji.storage.service.impl;

import com.yunji.storage.bo.DiscardRemoveBO;
import com.yunji.storage.bo.DiscardSelectQueryBO;
import com.yunji.storage.bo.StorageUpdateAuditBO;
import com.yunji.storage.dao.IDiscardTicketDao;
import com.yunji.storage.domain.DiscardTicketDO;
import com.yunji.storage.mapper.DiscardTicketMapper;
import com.yunji.storage.service.IDiscardTicketService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.storage.service.impl
 * @Title: DiscardTicketService
 * <p>
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-08-24 11:15:09      V1.0        HuaAo       新建类
 */
@Service
public class DiscardTicketServiceImpl implements IDiscardTicketService {

    @Resource
    DiscardTicketMapper discardTicketMapper;

    @Resource
    IDiscardTicketDao discardTicketDao;

    @Override
    public boolean deleteByTicket(DiscardRemoveBO bo) {
        return discardTicketDao.deleteByTicket(bo);
    }

    @Override
    public boolean create(DiscardTicketDO discardTicket) {
        return discardTicketDao.create(discardTicket);
    }

    @Override
    public DiscardTicketDO select(Long discardId) {
        return discardTicketMapper.selectById(discardId);
    }

    @Override
    public DiscardTicketDO select(DiscardSelectQueryBO bo) {
        return discardTicketDao.select(bo);
    }

    @Override
    public boolean update(DiscardTicketDO discardTicket) {
        return discardTicketDao.updateTicket(discardTicket);
    }

    @Override
    public boolean deleteDraft(Long... discardIds) {
        return discardTicketDao.deleteDraft(discardIds);
    }

    @Override
    public void resetAuditStatus(Long discardId) {
         discardTicketDao.resetAuditStatus(discardId);
    }

    @Override
    public boolean updateAuditStatus(StorageUpdateAuditBO auditBO) {
        return discardTicketDao.updateAuditStatus(auditBO);
    }
}